package com.bi.onlineEducation.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * recharge_log
 *
 * @author
 */
@Entity
@Table(name = "recharge_log")
@ApiModel(value = "com.bi.onlineEducation.domain.RechargeLogPo 充值记录")
@Data
public class RechargeLogPo implements Serializable {
    /**
     * 充值日志主键ID
     */
    @Id
    @Column(name = "rl_id")
    @GeneratedValue(generator = "JDBC")
    @ApiModelProperty(value = "充值日志主键ID")
    private Integer rlId;

    /**
     * 充值人
     */
    @Column(name = "l_id")
    @ApiModelProperty(value = "充值人")
    private Integer lId;

    @OneToOne(cascade = CascadeType.DETACH)//PurchasePo是关系的维护端，当删除 PurchasePo，会级联删除 CoursePo
    @JoinColumn(name = "l_id", referencedColumnName = "l_id", insertable = false, updatable = false)
    private LoginPo login;    //PurchasePo中的c_id字段参考CoursePo表中的id字段

    /**
     * 充值金额
     */
    @Column(name = "amount")
    @ApiModelProperty(value = "充值金额")
    private Integer amount;

    /**
     * 充值时间
     */
    @Column(name = "rl_create_time")
    @ApiModelProperty(value = "充值时间")
    private Date rlCreateTime;

    /**
     * 充值消息
     */
    @Column(name = "rl_message")
    @ApiModelProperty(value = "充值消息")
    private String rlMessage;

    private static final long serialVersionUID = 1L;
}